package com.maduar.mybatis.demo.mapstruct;

import com.maduar.mybatis.demo.entity.UserEntity;
import com.maduar.mybatis.demo.vo.UserVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Description:
 *
 * @author maduar maduar@163.com
 * @date 2021-04-10 19:58
 */
@Mapper(componentModel = "spring", unmappedSourcePolicy = ReportingPolicy.IGNORE)
@Component
public interface UserEntityMapper {

    @Mapping(source = "id", target = "id", numberFormat = "")
    UserVo doToVo(UserEntity in);

    UserEntity voTodo(UserVo in);

    List<UserVo> doToVoList(List<UserEntity> list);
}
